<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	template="/xhtml/templates/layout.xhtml">

	<ui:define name="title">#{msgs.VueCompetenceUtilisateur_tabTitle}</ui:define>

	<ui:define name="entete">
		<h:form id="enteteForme" styleClass="container-vertically-centered">
			<p:toolbar id="enteteTolBar" style="height: 30px;">
				<p:toolbarGroup id="enteteTolBarGroup" align="left">
					<h:commandButton id="first" image="/images/fleche1.png" action="vueFormateur.xhtml" style="width: 30px" title="Retour"/>
				</p:toolbarGroup>
				
				<p:toolbarGroup id="s" style="font-size: 12px" align="center">
						<h:outputText value="#{msgs.VueCompetenceUtilisateur_Competence_header}" />
				</p:toolbarGroup>
			</p:toolbar>
		</h:form>
	</ui:define>

	<ui:define name="vueCompetenceUtilisateur_layoutCompetence">
		<p:layout styleClass="myLayoutStyleClass" style="min-width: 100px; height:760px;  margin-bottom: 0.50%; margin-top: 0.50%" id="layout">
			<p:layoutUnit position="west" size="350" header="#{msgs.VueCompetenceUtilisateur_NewCompetence_header}" styleClass="myLayoutStyleClass">

				<h:form id="vueUtilisateur_optionButtonForm" styleClass="container-vertically-centered">
					<h:panelGrid id="vueUtilisateur_optionButtonFormGrid" columns="2">

						<h:outputLabel for="newTitre" value="#{msgs.VueCompetenceUtilisateur_NewCompetence_titre}" />
						<p:inputText id="newTitre" value="#{manageBeanCompetence.competence.titre}" label="Titre" required="true"/>
						
						<p:commandButton value="#{msgs.VueCompetenceUtilisateur_NewCompetence_enregistrer}" action="#{manageBeanCompetence.add}" ajax="false" />

					</h:panelGrid>
				</h:form>
			</p:layoutUnit>


			<p:layoutUnit position="center" header="#{msgs.VueCompetenceUtilisateur_Competence_Tableheader}" style="text-align:center;">
				<h:form id="bibliotheque_tableForme" styleClass="container-vertically-centered">

					<h:panelGrid id="vfFormateurGrid" columns="3" style="margin-left: 25%">
						<h:outputText value="#{msgs.VueCompetenceUtilisateur_Competence_nbCompetence}" />
						<h:outputText>
							#{manageBeanCompetence.service.nbCompetence}
						</h:outputText>
					</h:panelGrid>
				</h:form>

				<h:form id="D" styleClass="container-vertically-centered">
					<p:dataTable id="bibliotheque_tableDatatTable" var="competence" value="#{manageBeanCompetence.service.all}"
								 paginator="true" rows="15" rowKey="#{competence.key}" selection="#{manageBeanCompetence.selectedCompetence}" selectionMode="single" 
								  paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
								  rowsPerPageTemplate="15" style="margin-left: 25%; margin-right: 25%" >

						<f:facet name="header">
							<h:outputText value="#{msgs.VueCompetenceUtilisateur_tableHeader}" />
						</f:facet>
						
						<p:column id="IdColumn" headerText="#{msgs.VueCompetenceUtilisateur_tableHeaderTextId}">
							<h:outputText value="#{competence.idCompetence}" />
						</p:column>

						<p:column id="NomColumn" headerText="#{msgs.VueCompetenceUtilisateur_tableHeaderTextTitre}">
							<h:outputText value="#{competence.titre}" />
						</p:column>

						<p:column headerText="#{msgs.VueCompetenceUtilisateur_tableHeaderTextOption}">
							<p:commandButton value="#{msgs.VueCompetenceUtilisateur_tableHeaderTextEdit}" oncomplete="edit.show()" update="popoUpdateCompetence_Form" />
							<p:commandButton value="#{msgs.VueCompetenceUtilisateur_tableHeaderTextDel}" oncomplete="confirmation.show()" update="confirmationDeleteCompetence_Form" />
						</p:column>

					</p:dataTable>
				</h:form>
			</p:layoutUnit>
		</p:layout>
	</ui:define>

	<ui:define name="vueCompetenceUtilisateur_popoUpdateCompetence">
		<h:form id="popoUpdateCompetence_Form" styleClass="container-vertically-centered">
			<p:growl id="msgs" />
			<p:dialog id="dialogId" header="#{msgs.VueCompetenceUtilisateur_ModifCompetence_header}" widgetVar="edit" showEffect="explode" hideEffect="explode" height="320" width="290">
				<h:panelGrid id="bibliotheque_informationLivreGrid" columns="2">
						
					<h:outputText value="#{msgs.VueCompetenceUtilisateur_ModifCompetence_titre}" />
					<p:inplace editor="true" onEditUpdate="msgs">
						<p:inputText value="#{manageBeanCompetence.competence.titre}" style="width: 100px;" label="User update" required="true" />
					</p:inplace>

				</h:panelGrid>

				<p:commandButton value="#{msgs.VueCompetenceUtilisateur_ModifCompetence_enregistrer}" action="#{manageBeanCompetence.update}" ajax="false" />

			</p:dialog>
		</h:form>
	</ui:define>
	
	<ui:define name="vueCompetenceUtilisateur_popoDeleteCompetence">
		<h:form id="confirmationDeleteCompetence_Form" styleClass="container-vertically-centered">
			
			<p:confirmDialog message="#{msgs.VueCompetenceUtilisateur_SuppCompetence_text}" showEffect="bounce" hideEffect="explode" header="#{msgs.VueCompetenceUtilisateur_SuppCompetence_header}" severity="alert" widgetVar="confirmation">
				<p:commandButton value="#{msgs.VueCompetenceUtilisateur_SuppCompetence_non}" action="successUtilisateur" ajax="false" />
				<p:commandButton value="#{msgs.VueCompetenceUtilisateur_SuppCompetence_oui}" action="#{manageBeanCompetence.del}" ajax="false" />
			</p:confirmDialog>
			
		</h:form>
	</ui:define>

	<ui:define name="pieddepage">
		<h:form id="pieddepageForm" styleClass="container-vertically-centered">
			<p:toolbar id="pieddepageTolBar" style="height: 30px;">
				<p:toolbarGroup id="pieddepageTolBarGroup" align="center">
					<h:outputText value="#{msgs.VueCompetenceUtilisateur_Competence_Tablefooter}" />
				</p:toolbarGroup>
			</p:toolbar>
		</h:form>
	</ui:define>

</ui:composition>